package cn.liip.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.liip.demo.domain.Dept;
import cn.liip.demo.mapper.DeptMapper;

@Service  //  该注解一定要写，否则无法注册bean
public class DeptService {
	
	@Autowired
    private DeptMapper deptMapper;  //  注入mapper
	 /**
     * 获取所有部门信息
     * @return
     */
    public List<Dept> findAll(){
    	return deptMapper.findAll();
    } 
    /**
     * 添加部门 
     * @param dept
     */
    public void addDept(Dept dept) {
    	deptMapper.addDept(dept);
    }

}
